<?php

namespace Cck\ArticlesSystem\Http\Controllers;

use App\Http\Controllers\Controller as BaseController;

class Controller extends BaseController
{
    protected function view(string $view, array $data = [], array $mergeData = [])
    {
        return view('cck-articles-system::' . $view, $data, $mergeData);
    }

    protected function getWith()
    {
        $with = request('with', []);

        if (is_string($with)) {
            $with = array_unique(explode(',', $with));
        }

        return $with;
    }
}
